// @ts-ignore
/* eslint-disable */
import { AssetTypesResult, AssetTypesResultItem } from '@/services/api/model/assetTypesModel';
import { request } from '@umijs/max';
export async function getList(params: API.PageParams & API.CurrentParams) {
  return request<AssetTypesResult>(API_URL + '/superlink/api/assettypes', {
    method: 'GET',
    params,
  });
}

export async function delItem(id: string) {
  return request(API_URL + '/superlink/api/assettypes/delete/' + id, {
    method: 'DELETE',
  });
}

export async function createItem(data: AssetTypesResultItem) {
  return request(API_URL + '/superlink/api/assettypes/create', {
    method: 'POST',
    data,
  });
}
export async function updateItem(data: AssetTypesResultItem) {
  return request(API_URL + '/superlink/api/assettypes/update/' + data.token, {
    method: 'PUT',
    data,
  });
}

export async function getItemDetails(
  params: { includeAsset?: boolean; token: string },
  options?: { [key: string]: any },
) {
  return request<AssetTypesResultItem>(API_URL + '/superlink/api/assettypes/' + params.token, {
    method: 'GET',
    params,
    ...(options || {}),
  });
}
